<#setting number_format="#">
<style type="text/css">
    .layadmin-flexible {
        width: 150px;
        text-align: center;
        border-right: 0.1px solid #aaa;
    }

    .layui-body {
        margin-top: 2px;
        margin-left: -34px;
        overflow-y: hidden;
    }

    .top-menu-wrap {
        margin-top: 50px;
    }

    .layui-nav-item .selected {
        background: -webkit-linear-gradient(left, #406EE1 0%, #36349F 100%);
    }

    .layui-nav-item .top-menu {
        color: white !important;
    }

    .layui-layout-admin .layui-header .layui-nav .layui-nav-item, .layui-layout-admin .layui-logo {
        height: 40px;
        line-height: 40px;
    }

    .top-logo-line {
        color: white;
        position: absolute;
        font-size: 18px;
        padding: 18px 18px;
    }

    .top-logo-line img {
        width: 38px;
        margin-top: -14px;
    }

    .top-logo-line .title {
        padding-left: 20px;
        font-weight: 600;
        vertical-align: middle;
        display: inline-block;
        height: 40px;
    }

    .menu-ico {
        width: 16px;
        margin-right: 10px;
        margin-bottom: 2px;
    }

    .layui-nav {
        padding: 0 10px;
    }

    text.highcharts-credits {
        display: none;
    }

</style>
<script type="text/javascript">
    $(function () {
        var topMenu = $('.top-menu[href="' + location.pathname + location.search + '"]');
        if (topMenu.length > 0) {
            $('.top-menu').removeClass('selected');
            topMenu.addClass('selected');
        }
    });
</script>
<div id="header-top" class="layui-header" style="height:55px;background: linear-gradient(to bottom, #2a5298, #000e28);">
    <div class="top-logo-line">
        <img src="${logoUrl!}"/><span class="title"><span>${plateName!}${yezhuName!}</span> </span>
    </div>
    <ul class="layui-nav" style="left:0px;background: #627bd9;margin-top:10px;opacity: 0.8;margin-right: 20px;">
		<span class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">
			<li class="layui-nav-item layui-hide-xs" lay-unselect>
				<a href="javascript:;" onclick="goFullscreen();" style="color:white;"> <i
                            class="layui-icon layui-icon-screen-full"></i></a>
			</li>
			
			<li class="layui-nav-item" lay-unselect>
				<a href="javascript:;"> <cite style="color:white;margin-right:10px;">${realName!}</cite></a>
				<dl class="layui-nav-child" style="top:40px">
					<dd>
						<a onclick="resetMyPwd()" href="javascript:void(0)">修改密码</a>
					</dd>
					<hr/>
                    <dd>
						<a onclick="downloadApp()" href="javascript:void(0)">下载app</a>
					</dd>
					<hr/>
					<dd>
						<a onclick="updateApp()" href="javascript:void(0)">上传app</a>
					</dd>
					<hr/>
					<dd>
						<a id="uploadLogoBtn" href="javascript:void(0)">上传logo</a>
					</dd>
					<hr/>
					<dd style="text-align: center;">
						<a onclick="doLogout()" href="#">退出</a>
					</dd>
				</dl>
			</li>
		</span>
    </ul>
    <ul class="layui-nav layui-layout-right" lay-filter="layadmin-layout-right">

    </ul>
</div>
<#if commonIncludeFtls?? && (commonIncludeFtls?size > 0)>
<#list commonIncludeFtls as comFtlName>
	<#include "/${comFtlName}">
</#list>
</#if>
<script type="text/javascript">
	
	layui.use(function () {
    	var layer = layui.layer;
    	layui.upload.render({
            elem: '#uploadLogoBtn',
            url: '/frame/uploadLogo',
            accept: 'file',
            done: function (res) {
                if (res.code == 0) {
                    layer.msg('上传成功',{shade: [0.1,'#fff'], time:1600});
                }else{
                	layer.msg('上传失败'+res.desc,{shade: [0.1,'#fff'], time:1600});
                }
            }
        });
        //doSearch(1);
    });
	
    function resetMyPwd() {
        layer.open({
            maxmin: true,
            type: 2,
            title: '重置密码',
            area: ['500px', '400px'],
            content: '/userPermission/systemUser/resetMyPwd'
        });
    }
    function downloadApp() {
        layer.open({
            type: 2,
            title: 'app下载',
            area: ['380px', '400px'],
            content: '/app/top/qrCode'
        });
    }
    function updateApp() {
        layer.open({
            type: 2,
            title: 'app上传',
            area: ['550px', '280px'],
            content: '/app/top/updateApp'
        });
    }
    
    function doLogout() {
        // 让cookie失效
        setCookie('_lastRequestUrl', '', 1);
        
        sajax({
            type: "POST",
            url: '/logout',
            data: {
            },
            success: function (data) {
                window.location = "/login";
            }
        });
    }

    function goFullscreen() {
        $('#header-top').hide();
        $('#sideMenu').hide();
        $('.layui-body').css('top', '-10px');
        $('.layui-body').css('left', '0px');
    }

    function restore() {
        $('#header-top').show();
        $('#sideMenu').show();
        $('.layui-body').css('top', '45px');
        $('.layui-body').css('left', '186px');
        $('.layui-body').css('margin-left', '0px');
    }

    $(document).keyup(function (e) {
        var key = e.which || e.keyCode;
        if (key == 27) {
            restore()
        }
    })

</script>